package com.sl.plugin.step.file;

import cn.hutool.core.util.ObjectUtil;
import com.sl.core.engine.meta.ProcessCompDescriptorService;
import com.sl.core.engine.meta.impl.AbstractProcessCompDescriptor;
import com.sl.core.engine.meta.row.ProcessRowDescriptor;
import lombok.Getter;
import org.apache.hop.core.row.value.ValueMetaString;

import java.util.Map;

/**
 *
 */
@Getter
public class ExcelOutputCompDescriptor extends AbstractProcessCompDescriptor<
        ExcelOutputComp, ExcelOutputCompContext> implements ProcessCompDescriptorService {


    @Override
    public void loadDescriptor(Map<String, Object> map) {
        //标记是结束
        setIsEndStep(true);
    }


    @Override
    public ProcessRowDescriptor getResultDescriptor(ProcessRowDescriptor rowDescriptor) {
        ProcessRowDescriptor processRowDescriptor = new ProcessRowDescriptor();
        processRowDescriptor.setBasicTypeFlag(false);
        processRowDescriptor.setIsArray(false);
        ValueMetaString valueMetaString = new ValueMetaString();
        valueMetaString.setName("downloadPath");
        valueMetaString.setComments("文件下载地址");
        processRowDescriptor.addValueMeta(valueMetaString);
        return processRowDescriptor;
    }

}
